<template>
	<view class="myBox">
		<view class="topTitle flex-sp-center">
			<view class="Title">
				医联•互联网医院
				<view class="">开启美好的一天</view>
			</view>
			<view class="flex-center-center">
				<view class="ScanCode flex-center-center">
					<image src="@/static/my/scan.png" mode=""></image>
					扫一扫
				</view>
				<view class="tz">
					<image src="@/static/CommonTools/tz.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="doctor">
			<view class="" @click="goinfo('pages/my/MyProfile/MyProfile')">
				<view class="title flex-center">
					<image :src="data.avatar" mode=""></image>
					<view class="nameBox">
						<view class="name">
							{{ data.name }}
							<text>{{ data.titleName }}</text>
							<text>{{ data.departName }}</text>
						</view>
						<view class="typeBox" v-if="levelName">
							<text>{{ data.levelName }}</text>
							{{ data.hospitalName }}
						</view>
						<view class="setUp">点击设置资料</view>
					</view>
					<view class="code" @click.stop="Uppop()">
						<image src="@/static/my/code.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
		<view class="nav flex-sp-center">
			<view class="sfjl" @click="goinfo('pages/Pharmacist/list/list')">
				审方记录
				<view class="">
					审方记录有迹可循
				</view>
			</view>
			<view class="wdtd" @click="goinfo('pages/my/MyTeam/teamList')">
				我的团队
				<view class="">
					快速查看团队人员
				</view>
			</view>
		</view>
		<view class="currency_card configurationBox">
			<view class="configuration flex-sp-center" @click="goinfo('pages/my/ComplaintSuggestions/ComplaintSuggestions')">
				<view class="">
					<image src="@/static/my/12.png" mode="aspectFit"></image> 投诉建议
				</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
			<view class="configuration flex-sp-center" @click="goinfo('pages/my/system/system')">
				<view class="">
					<image src="@/static/my/14.png" mode="aspectFit"></image>设置
				</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
			<view class="configuration flex-sp-center" @click="goinfo()">
				<view class="">
					<image src="@/static/my/15.png" mode="aspectFit"></image>关于我们
				</view>
				<view class="more">
					<uni-icons type="right" color="#999999" size="16"></uni-icons>
				</view>
			</view>
		</view>
		<uni-popup ref="popup" type="center">
			<view class="">
				<QRCode :code="data.id"></QRCode>
			</view>
		</uni-popup>
		<UnauditedPup :data="data.auditStatus"></UnauditedPup>
		<view class="PharmacistTabber">
			<view class="" @click="goinfo('pages/Pharmacist/Pharmacist')">
				<image src="@/static/icon/1.png" mode=""></image>
				<view class="">
					工作台
				</view>
			</view>
			<view class="">
				<image src="@/static/icon/41.png" mode=""></image>
				<view class="act">
					我的
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getPharmacistInfo
	} from '@/api/user'
	import {
		createGroup
	} from '@/utils/TIM'
	export default {
		data() {
			return {
				data: {},
			}
		},
		onShow() {
			this.getPharmacistInfo()
		},
		methods: {
			Uppop() {
				this.$refs.popup.open('center')
			},
			// 创建会话
			handleCreateConversation(userID) {
				createGroup(userID)
			},
			getPharmacistInfo() {
				getPharmacistInfo().then(res => {
					this.data = res.data
				})
			},
			goConsultationList(e) {
				uni.navigateTo({
					url: `/pages/ConsultationRoom/consultationList/consultationList?type=${e}`,
				})
			},
			goConsultationRoom(e) {
				uni.navigateTo({
					url: `/pages/ConsultationRoom/index?type=${e}`,
				})
			},
			goAppointment(e) {
				uni.navigateTo({
					url: `/pages/ConsultationRoom/TodayAppointment/TodayAppointment?type=${e}`,
				})
			},
			goinfo(e, id) {
				if (id) {
					uni.navigateTo({
						url: `/${e}?id=${id}`,
					})
				} else {
					uni.navigateTo({
						url: `/${e}`,
					})
				}
			},
		},
	}
</script>

<style lang="less" scopde>
	.nav {
		padding: 30rpx;

		&>view {
			width: 335rpx;
			height: 146rpx;
			padding: 40rpx 0 0 120rpx;
			box-sizing: border-box;
			background-image: url(@/static/Pharmacist/sfjl.png);
			background-size: 100% 100%;
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;

			view {
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
			}
		}

		.wdtd {
			background-image: url(@/static/Pharmacist/wdtd.png);
		}
	}

	.listTop {
		background-image: url(@/static/Pharmacist/titleBg.png);
		height: 94rpx;
		background-size: 100% 100%;
	}

	.configurationBox {
		margin: 0 30rpx;
		margin-top: 20rpx;
		padding: 0 20rpx;

		.text {
			font-size: 28rpx;
			font-weight: 500;
			color: #333;
			line-height: 40rpx;
			padding: 30rpx 0;
		}

		.configuration {
			font-size: 30rpx;
			font-weight: 500;
			color: #333333;
			height: 97rpx;
			border-bottom: 1px solid #eeeeee;

			&:last-child {
				border-bottom: none;
			}

			&>view {
				display: flex;
				align-items: center;
			}

			.more {
				font-size: 26rpx;
				color: #999999;
			}

			image {
				width: 47rpx;
				height: 38rpx;
				margin-right: 15rpx;
			}
		}

	}

	.PharmacistTabber {
		width: 750rpx;
		height: 98rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(153, 153, 153, 0.3);
		position: fixed;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: space-around;
		font-weight: 500;
		font-size: 26rpx;
		text-align: center;
		color: #999999;

		.act {
			color: #3E6EFE;
		}

		image {
			width: 38rpx;
			height: 38rpx;
		}
	}

	.listTop {}

	.shu {
		width: 1rpx;
		height: 25rpx;
		background-color: #eee;
		margin: 0 12rpx;
	}

	.B_xian {
		border-bottom: 1px solid #EEEEEE;
	}


	.Unaudited {
		width: 100%;
		height: 100vh;
		position: fixed;
		top: 0%;
		left: 0%;
		background-color: #00000080;


		.box {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			border-radius: 20rpx;
			width: 400rpx;
			height: 420rpx;
			background-color: #fff;
			text-align: center;
			padding: 20rpx;
			box-sizing: border-box;

			image {
				width: 205rpx;
				height: 168rpx;
			}

			.title {
				text-align: center;
				font-weight: bold;
				font-size: 36rpx;
				color: #333;
				margin-top: 20rpx;
			}

			.btn {
				font-weight: 500;
				font-size: 26rpx;
				color: #3E6EFE;
				margin-top: 25rpx;
			}

			.text {
				margin-top: 10rpx;
				width: 100%;
				color: #999;
				font-size: 26rpx;
				text-align: left;
			}
		}
	}

	.myBox {
		min-height: 100vh;
		background-image: url(@/static/Pharmacist/indexBg.png);
		background-size: 100% 1026rpx;
		background-repeat: no-repeat;
		box-sizing: border-box;


		.doctor {
			min-height: 182rpx;
			border-radius: 30rpx;
			padding: 0 30rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: space-around;

			&>view {
				width: 100%;
			}

			.title {
				.code {
					image {
						width: 63rpx;
						height: 60rpx;
					}
				}

				.nameBox {
					flex: 1;
				}

				.name {
					font-weight: bold;
					font-size: 32rpx;
					margin-bottom: 10rpx;
					color: #333333;

					text {
						font-weight: 500;
						font-size: 24rpx;
						color: #666666;
						margin-left: 19rpx;
					}
				}

				image {
					width: 118rpx;
					height: 118rpx;
					border-radius: 50%;
					margin-right: 21rpx;
				}
			}

			.typeBox {
				margin-top: 5rpx;

				text {
					display: inline-block;
					width: 63rpx;
					height: 33rpx;
					background: #def7ed;
					border-radius: 10rpx;
					font-weight: 500;
					font-size: 22rpx;
					color: #23cc88;
					text-align: center;
					line-height: 33rpx;
					margin-right: 10rpx;
				}
			}

			.setUp {
				margin-top: 5rpx;
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
			}
		}

		.topTitle {
			padding: 51rpx 30rpx 0;
			box-sizing: border-box;

			.Title {
				font-weight: 800;
				font-size: 34rpx;
				color: #333333;

				view {
					font-weight: 500;
					font-size: 24rpx;
					color: #999999;
				}
			}

			.tz {
				image {
					width: 60rpx;
					height: 68rpx;
				}
			}

			.ScanCode {
				width: 145rpx;
				height: 60rpx;
				border-radius: 35rpx;
				border: 2px solid #3e6efe;
				font-weight: 500;
				font-size: 24rpx;
				color: #3e6efe;
				margin-right: 32rpx;

				image {
					width: 24rpx;
					height: 24rpx;
					margin-right: 9rpx;
				}
			}
		}
	}
</style>